UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dxJZe5xwA9JoC8/gtrf3eWtmodCt5Jdbrb6yHWaqP+0='
WHERE
key_id = '13f0edc087d838e620de2089e6a9273ab0692c60c98a479266d32dbee1685380'
AND (
token = 'dxJZe5xwA9JoC8/gtrf3eWtmodCt5Jdbrb6yHWaqP+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)