UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0NhR60KuC+1WUQQMGAFHkjHVxfigmjfwnmgQuMcH/uw=' 
WHERE 
  key_id = '28fd05ec21ef5c5e1efa2a3b85f98c7960a33705f4125cd4f8d744956584eb4b' 
  AND (
    token = '0NhR60KuC+1WUQQMGAFHkjHVxfigmjfwnmgQuMcH/uw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032