UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sMsM5I/SWM9gQbwcqlF14uS0M7sF7iM4hyrH7wEkcqE=' 
WHERE 
  key_id = '294e19f00ecc4a963e983e4d81b2c62f21b6454df387cefa5ba82b167863575f' 
  AND (
    token = 'sMsM5I/SWM9gQbwcqlF14uS0M7sF7iM4hyrH7wEkcqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028