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