UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ciRfzsM1l3qd5K726/Y4Ocb7uP1B0PV0XihqCn7iTS0=' 
WHERE 
  key_id = '034e98c69ecd6d99d027c395692f606af198e8f775cd69eb9df4d0ce14efcdc4' 
  AND (
    token = 'ciRfzsM1l3qd5K726/Y4Ocb7uP1B0PV0XihqCn7iTS0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021