UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4/CBTgZQn8jq7M0mRMDBg5xI053hfli9GvidXuONQMY='
WHERE
key_id = '88ab16a03515edc0c7c75317b1640f2560d94bf14927d4e0db5c7c50268a83df'
AND (
token = '4/CBTgZQn8jq7M0mRMDBg5xI053hfli9GvidXuONQMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)