UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qkd2Lv3o7pLsuYeO/nbxbAD4EXzGFiM2TG6GrVC4FkM='
WHERE
key_id = '3a81e3c6184db0ad7d7d165e3ee786aca3089359faac40a6eecd587673e9dc78'
AND (
token = 'qkd2Lv3o7pLsuYeO/nbxbAD4EXzGFiM2TG6GrVC4FkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)