UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jFi2OOpNe5Z8PMLcoAan3bT6P/CnEtflhtGbgQqIo1w='
WHERE
key_id = 'c56baaeb25bec507045ce1451f4e3e94373b409b3010c2405db3dbfacb343da3'
AND (
token = 'jFi2OOpNe5Z8PMLcoAan3bT6P/CnEtflhtGbgQqIo1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)