UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vnqWQ1MEptThnaZO+hvKTIFcjYChPAf7bOiznfFwiyY='
WHERE
key_id = '9c67a9fea6d7e3826bc7faed6a2e12b8c55f3e8b2bb834f89a8a8064168a0a36'
AND (
token = 'vnqWQ1MEptThnaZO+hvKTIFcjYChPAf7bOiznfFwiyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)