UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xVPlQ+w/x26vUPRSXEtB2qMhNk7X0RYanJzytiPzFI4='
WHERE
key_id = '4c9c7de47fd7338e7a86a58a73e2560915d023e42771509637ae26f60f3acf61'
AND (
token = 'xVPlQ+w/x26vUPRSXEtB2qMhNk7X0RYanJzytiPzFI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)