UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vWfnix6zICJyb9tUvSbpmrl/57Iej2Xm7FitthWhOxY=' 
WHERE 
  key_id = 'ffddfbd3caeb0e9a933d6b1a1ecd5a87d772d9e1e37690f40323e1a1dea34ee8' 
  AND (
    token = 'vWfnix6zICJyb9tUvSbpmrl/57Iej2Xm7FitthWhOxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023