UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+EyT7kKOhqeUq86IMRBynn6oZBWT8yKVphfx9B9I5ZU='
WHERE
key_id = '23ee79ae43032077400029e37feb3ed2c27ce601e8058252a2671a9d05ea12ac'
AND (
token = '+EyT7kKOhqeUq86IMRBynn6oZBWT8yKVphfx9B9I5ZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)