UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YRXDOpo5q3r/a1XHfW/0PV9g9F8WMJwYATsg1WYlU5w=' 
WHERE 
  key_id = '5ecf2fa8697233ce43b1da4ac399778cd618a1e32599aecf85c51305ba8a7c2d' 
  AND (
    token = 'YRXDOpo5q3r/a1XHfW/0PV9g9F8WMJwYATsg1WYlU5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020