UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/hlawvfhpy9eBOMjMKNcRrZDK5BAJ7z9uDnNLE81Io=' 
WHERE 
  key_id = 'a9b492023d12e45b4e84b486b3fde82ca7487685b75d543fdc8adeea37b9156f' 
  AND (
    token = 'l/hlawvfhpy9eBOMjMKNcRrZDK5BAJ7z9uDnNLE81Io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035