UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IT1AdbdIYWuwpIbBFitBUY4GEAQUmnvYJ0jSawY/Nmw=' 
WHERE 
  key_id = 'e2f431a1a1fefdaa44895e99920319e7c41ea5e0db8812fd3ded4cf4b3211ccc' 
  AND (
    token = 'IT1AdbdIYWuwpIbBFitBUY4GEAQUmnvYJ0jSawY/Nmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046