UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ba/NbC0sJXTPlLD9FkTLl/nsCj+42iFByMz2NAAwh0='
WHERE
key_id = '6775d3629107051bb4d206415c465dc3a84724db338480b612aa0103e1b6fd56'
AND (
token = '4ba/NbC0sJXTPlLD9FkTLl/nsCj+42iFByMz2NAAwh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)