UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/CeJCmivPAvxOFXDMHTo+ghrebmDJb8g/azcFdrA4Q=' 
WHERE 
  key_id = 'e918f62064588272e7fc4c54474b068a1215e279ea8bc006ef262db76f34a960' 
  AND (
    token = 'U/CeJCmivPAvxOFXDMHTo+ghrebmDJb8g/azcFdrA4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039