UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F+JbzlU0H8fYkEwNHYOLyghBPs8MjKmMDWHhMJdPW2c=' 
WHERE 
  key_id = '8db81880891d041aa0bf02dc6e112537ae32055f68bb2e541ea6fb8b783675e7' 
  AND (
    token = 'F+JbzlU0H8fYkEwNHYOLyghBPs8MjKmMDWHhMJdPW2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020