UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c/BYfSNQf4MWEXVXCXf1JtKN3nbBSu4hsI97w2bD3Tk='
WHERE
key_id = '0722a67f7bde12c26c60bc1f352dd5b58e0570a36bc112d4e6d42f97e0c3146b'
AND (
token = 'c/BYfSNQf4MWEXVXCXf1JtKN3nbBSu4hsI97w2bD3Tk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)