UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bnoJNwsqNPC8jz/dbDynY6Kq9CzVoM5rfl+GNVQHEUo=' 
WHERE 
  key_id = 'a68caba43918938d9b8c95e472474266017445d4adebf5102b1b6adb0217d9b8' 
  AND (
    token = 'bnoJNwsqNPC8jz/dbDynY6Kq9CzVoM5rfl+GNVQHEUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043