UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kbr3SNXBYf9Grepo0/oWaTiwKx/yxBqbLYs6ri8IBsw='
WHERE
key_id = 'bfbfad63c38e3a0f4539e16899012710fda9f6451f89c18100de0aebf938b3db'
AND (
token = 'Kbr3SNXBYf9Grepo0/oWaTiwKx/yxBqbLYs6ri8IBsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)