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

Query time 0.00058