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