UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tlf0Af3fM9bewV33K7R2cRUukmwPG7Wnb57ixnudU2o=' 
WHERE 
  key_id = 'ac6f8d00876c5d44ac012211311f228edd1952bbb066057a0b366edfd169d200' 
  AND (
    token = 'Tlf0Af3fM9bewV33K7R2cRUukmwPG7Wnb57ixnudU2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043