UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kujYckCUQ3I2Z0ExEk4iKFuyBfuar9lK1WZ6iWuDeYY=' 
WHERE 
  key_id = '9226835525eb134f6879a6757662ed0b2d50aa2033c9fc3af4f96c4f215354c2' 
  AND (
    token = 'kujYckCUQ3I2Z0ExEk4iKFuyBfuar9lK1WZ6iWuDeYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029