UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lQEVKMstFEZq5uxzNkx5fobcaHtvzXOQMjO8oTymHO4='
WHERE
key_id = 'f84001aeb3c216803046b5ac9e22921a119009f26d7bb38cc12cf2a5a9ea2aa7'
AND (
token = 'lQEVKMstFEZq5uxzNkx5fobcaHtvzXOQMjO8oTymHO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)