UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CN9YkbOoB5n0qywtvO7bIB694y4sSJ5Boib+d0mZUt0='
WHERE
key_id = '7533d8006e0eadbef2783cbe96ab7d7f16defcc92ba67a93653ffba80b2f5072'
AND (
token = 'CN9YkbOoB5n0qywtvO7bIB694y4sSJ5Boib+d0mZUt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)