UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cp+VmpFGQzy30qlbBEN5acUGIPvJwD6lhYzJRAftc5o='
WHERE
key_id = '117dedd0e9d6fe93e869404aeadc806813ad1bdb04920c883fbf3bc1e5223368'
AND (
token = 'cp+VmpFGQzy30qlbBEN5acUGIPvJwD6lhYzJRAftc5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)