UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ToR8TGI/zWwqpz15Dw5PTih4LQonwa9ImHS03j9Zis='
WHERE
key_id = '9c5260771f0fdb425b61b88d251a828b60810e7c706e5f7a41b0d47f87dc91b9'
AND (
token = '+ToR8TGI/zWwqpz15Dw5PTih4LQonwa9ImHS03j9Zis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)