UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E7KfKA6EYYtuGkgDiN/I5RDXUmorY7ezd+BjywFV3Ow='
WHERE
key_id = '92d6f7cd852e1c0493fa97699f34e03b1e29133d433b2a6144e6733c460184a4'
AND (
token = 'E7KfKA6EYYtuGkgDiN/I5RDXUmorY7ezd+BjywFV3Ow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)