UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lWT9YkOOYot1mpXYZc00OdjloMFb5arZ7RyTZGTIVrY=' 
WHERE 
  key_id = '835c12456cd518f9a544da1a0e3887946e956aca94ac572fb411a8362ba7f0a2' 
  AND (
    token = 'lWT9YkOOYot1mpXYZc00OdjloMFb5arZ7RyTZGTIVrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046