UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1BxHIFr9gy87T8FXU/RDJrmBBek1QQSqKtJYTFIWWfQ=' 
WHERE 
  key_id = '4a47367dd2674631f24c3a25251f3c88f21abbb3a95c68ff16f283d9b6d1f6fd' 
  AND (
    token = '1BxHIFr9gy87T8FXU/RDJrmBBek1QQSqKtJYTFIWWfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036