UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RPawZBEV0tWZNyk9hbc8jIdHJ+p/qUoL2oL5MN0s6mw='
WHERE
key_id = '08558dda87c9648c0a7746bb9f85bdfd261f9f105f468a8c5d165ec9e13d7325'
AND (
token = 'RPawZBEV0tWZNyk9hbc8jIdHJ+p/qUoL2oL5MN0s6mw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)