UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H07SzOHocACEIuw4UARDQIkKYGsVLcl/eFSrsByF6lw='
WHERE
key_id = '30814369aa1f2d488f1b5d9a8572c2039482438002dd6eea06e947ce594d3de4'
AND (
token = 'H07SzOHocACEIuw4UARDQIkKYGsVLcl/eFSrsByF6lw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)