UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U/0B4hve2ujB9nKBuGVSqHToXLcnnBFDrjUlBV9kcQk='
WHERE
key_id = '8beaa3906a0a59ea30724597f9b99a70c3d75d6be611de63b4c9dfcf291e8a52'
AND (
token = 'U/0B4hve2ujB9nKBuGVSqHToXLcnnBFDrjUlBV9kcQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)