UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SS1XBLtM+iaTut9ZLmrTk1V3jFSSZ/XlwAUogKz40lY='
WHERE
key_id = '44ad4614f55da375fc2bbef5f2f76d1b0146681091a64fb2a2fd17e4d085feba'
AND (
token = 'SS1XBLtM+iaTut9ZLmrTk1V3jFSSZ/XlwAUogKz40lY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)