UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p8k7ON3DyaUPP1qR4owAg2xrTm6S5wuvGpGd1E7ob7E=' 
WHERE 
  key_id = '10f16926cbd272b7192980d8d97c6bafbf60537adcec0e4dd630ec7f6fcef202' 
  AND (
    token = 'p8k7ON3DyaUPP1qR4owAg2xrTm6S5wuvGpGd1E7ob7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035