UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a96iGOy3BnamQu5XPFo+e99Og8acReb0jDEK8uBuiB0=' 
WHERE 
  key_id = '98f4cc6ed3d58715f673e4b3d95c23e819671fe995202aa234d5cefa72dd14a2' 
  AND (
    token = 'a96iGOy3BnamQu5XPFo+e99Og8acReb0jDEK8uBuiB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026