UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CiXQWVXGGPTIjIPlotnwXj2Ltke/KPgyDuSOEUgqdBg='
WHERE
key_id = '4ecfce739e21ca38c84a0291223dae7ec78015d9374fba411ad92f39f3f4e674'
AND (
token = 'CiXQWVXGGPTIjIPlotnwXj2Ltke/KPgyDuSOEUgqdBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)