UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gFulxIrTEnSuMU8xK/B7MM2Vyts4LRPhw782nIOF9xU='
WHERE
key_id = '40055709c05d2aec73fc70f4159ce130e8095c960887d979a9cf830616623f14'
AND (
token = 'gFulxIrTEnSuMU8xK/B7MM2Vyts4LRPhw782nIOF9xU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)