UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e8aBYaJzRT0K2F2nph0bWTiSxf0SCZztT5WnFti6I/g=' 
WHERE 
  key_id = '8a40d84e85eea15d3fc0c6f195200e3c25333eca9fee79729d50a06d2b6a4c36' 
  AND (
    token = 'e8aBYaJzRT0K2F2nph0bWTiSxf0SCZztT5WnFti6I/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034