UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4/iGq3G0Q/cpoU9vBVCOG/qc9esn6NxlnKVNjZAw1AE='
WHERE
key_id = 'a0cf781926e5ecc837caa897803cf5d3264116ea88a3d4ff3321a52044cfb5f2'
AND (
token = '4/iGq3G0Q/cpoU9vBVCOG/qc9esn6NxlnKVNjZAw1AE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)