UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QUIO+Td8hUW3qFPelPmWR5bXAXBUOYeZhovKTokzSgA='
WHERE
key_id = '8ffd46c9e7329c8030573ecaa7e7fdae26250e13db00336279fd9046ee7cb474'
AND (
token = 'QUIO+Td8hUW3qFPelPmWR5bXAXBUOYeZhovKTokzSgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)