UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BBi0a1MkZ4rcmaC9Az8ME5HaffD161PNHWpCm2c5lHY='
WHERE
key_id = '98a00e31817abe3bf7c089a84174904e40da5dd709a7f11e093ed102185c78db'
AND (
token = 'BBi0a1MkZ4rcmaC9Az8ME5HaffD161PNHWpCm2c5lHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)