UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ZPyNv/t+OJKwRBb75dIGN9J8+qmxsQQOy4XbnG0y4w='
WHERE
key_id = '259c841264fe93d6bd74268d30b3c1c6ce221794a6261672f61466d4b7763097'
AND (
token = '7ZPyNv/t+OJKwRBb75dIGN9J8+qmxsQQOy4XbnG0y4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)