UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UFkoZizSsAU0W2l9N54UkqHG5eUMwZEF/DzXq4VrJMw=' 
WHERE 
  key_id = '5d575572e508989b05a58d370ad06a3f52c407add89a4da128bee577a9b4d77c' 
  AND (
    token = 'UFkoZizSsAU0W2l9N54UkqHG5eUMwZEF/DzXq4VrJMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033